<include file="Public:header" />
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>系统消息列表</h3></div>
                <div class="fr">
                    <form class="search-form" method="post" action="">
                        <span>查询条件:</span>
                        <select name="field">
                            <option value="state" <if condition="$filter.field eq 'state'">selected="selected"</if>>状态</option>
                        </select>
                        <input name="value" value="{$filter.value}" type="text" placeholder="输入关键字按回车" />
                        <input name="page" value="{$filter.page}" type="hidden" />
                        <input name="order_field" value="{$filter.order_field}" type="hidden" />
                        <input name="order_sort" value="{$filter.order_sort}" type="hidden" />
                        <button class="btn-normal" type="submit">查 询</button>
                    </form>
                </div>
            </div>
            <div class="line2">
                <div class="fl form-btn-group">
                    <button onclick="action_readNoticeBatch()" class="btn-create btn-highlight">设置为已读</button>
                </div>
                <div class="fl form-btn-more">
                    <button class="btn-normal btn-more">更多操作<i class="drop-down"></i></button>
                    <ul class="more-action hidden">
                        <li><a onclick="action_del();" href="javascript:void(0);">删 除</a></li>
                    </ul>
                </div>
                <div class="fr form-search-count">
                    <span class="offset">({$page.from}-{$page.to})</span>
                    <span class="total">共{$page.total}条</span>
                    <button onclick="PageJump({$page.prevPage});" class="btn-normal">上一页</button>
                    <button onclick="PageJump({$page.nextPage});" class="btn-normal">下一页</button>
                </div>
            </div>
        </div>
    </div>
    <div class="form-box">
        <table class="list">
            <thead>
                <tr>
                    <th width="3%"><input id="select-all" type="checkbox" /></th>
                    <th class="list-header" field="name" sort="{$filter.order_sort}">
                        标题<if condition="$filter.order_field eq 'name'"><i class="icon-{$filter.order_sort}"></i></if>
                    </th>
                    <th field="link" sort="{$filter.order_sort}">
                        链接<if condition="$filter.order_field eq 'link'"><i class="icon-{$filter.order_sort}"></i></if>
                    </th>
                    <th class="list-header" field="community" sort="{$filter.order_sort}">
                        小区名称<if condition="$filter.order_field eq 'community'"><i class="icon-{$filter.order_sort}"></i></if>
                    </th>
                    <th class="list-header" field="cuser" sort="{$filter.order_sort}">
                        消息发送人<if condition="$filter.order_field eq 'cuser'"><i class="icon-{$filter.order_sort}"></i></if>
                    </th>
                    <th class="list-header" field="ctime" sort="{$filter.order_sort}">
                        消息发送时间<if condition="$filter.order_field eq 'ctime'"><i class="icon-{$filter.order_sort}"></i></if>
                    </th>
                    <th class="list-header" field="state" sort="{$filter.order_sort}">
                        状态<if condition="$filter.order_field eq 'state'"><i class="icon-{$filter.order_sort}"></i></if>
                    </th>
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="vo" key="index">
                    <tr offset="{$vo.offset}" data-id="{$vo.id}">
                        <td class="checkbox-cell"><input class="checkbox" data-id="{$vo.id}" type="checkbox" /></td>
                        <td>{$vo.name}</td>
                        <td>
                            <a onclick="action_ReadNotice('{$vo.id}', '{$vo.link}')" href="javascript:void(0);">
                                点击查看详情
                            </a>
                        </td>
                        <td>{$vo.community}</td>
                        <td>{$vo.cuser}</td>
                        <td>{$vo.ctime}</td>
                        <td>{$vo.state}</td>
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
</div>
<script>
    function action_readNoticeBatch(){
        var dataIds = new Array();
        $(".checkbox").each(function(){ //由于复选框一般选中的是多个,所以可以循环输出
            if($(this).is(":checked")){
                dataIds.push( parseInt($(this).attr("data-id")));
            }
        });
        if(dataIds.length==0){
            alert("请选择要操作的对象");
            return false;
        }
        $.ajax({
            url:"/admin/notice/ajax_ReadNoticeBatch",
            data: {info:dataIds}, type:"POST", dataType:"JSON",
            success: function(data){
                if(data.status){
                    location.reload();
                }else{
                    alert(data.info);
                }
            }
        });
    }
</script>
<script src="__JS__/notice.js" type="text/javascript" ></script>
<include file="Public:footer" />

